package main

import (
	"gin_demo/common"
	"github.com/gin-gonic/gin"
	"gorm.io/gorm"
)



func main(){
	db := common.InitDB()
	//关闭连
	defer func(db *gorm.DB){
		sqlDB, _ := db.DB()
		sqlDB.Close()
	}(db)
	r := gin.Default()
	r = CollectRouter(r)
	panic(r.Run(":9090")) // 监听并在 0.0.0.0:8080 上启动服务
}



